package com.khyr.feign;

import com.khyr.entity.DictData;
import com.khyr.vo.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class DictTypeFallbackFactory implements FallbackFactory<DictTypeFeign> {
    @Override
    public DictTypeFeign create(Throwable cause) {
        return new DictTypeFeign() {
            @Override
            public R<List<DictData>> getDictDataByType(String dictType) {
                return new R<List<DictData>>(500,"服务器故障",null);
            }
        };
    }
}
